<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="keys" content="">
    <meta name="author" content="">
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.css}">
    <link rel="stylesheet"  th:href="@{/css/font-awesome.min.css}">
    <link rel="stylesheet"  th:href="@{/css/login.css}">

    <style>

    </style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <div><a class="navbar-brand" href="/" style="font-size:32px;">Health-互联网医药平台</a></div>
        </div>
    </div>
</nav>

<div class="container">

    <form id="form2"  th:action="@{/user/login}" method="post" class="form-signin" role="form">
        <h2 class="form-signin-heading"><i class="glyphicon glyphicon-user"></i> 用户登录</h2>
        <div class="form-group has-success has-feedback">
            <input type="text" class="form-control" id="userName" name="userName" placeholder="请输入登录账号" autofocus>
            <span id="user" class="glyphicon glyphicon-user form-control-feedback"></span>
        </div>
        <div class="form-group has-success has-feedback">
            <input type="password" class="form-control" id="password" name="password" placeholder="请输入登录密码" style="margin-top:10px;">
            <span id="pass" class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>
        <div class="checkbox">
            <label>
                <span th:text="${msg}"></span>
            </label>
            <br>
            <label style="float:right">
                <a href="/reg">我要注册</a>
            </label>
        </div>
        <input id="denglu" class="btn btn-lg btn-success btn-block" type="submit" value="登录"> </input>
    </form>
</div>
<script th:src="@{/jquery/jquery-2.1.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
<script>

    $(function () {
        $('input').focus(function () {
            $('input').css("border-color", "#3c763d");
        });
        $('#denglu').click(function panduan() {
            if ($("#userName").val() == "" ) {
                $("#userName").css("border-color", "red");
                $('#userName').attr("placeholder", "用户名不能为空");
                $('#user').attr("class", "glyphicon glyphicon-remove form-control-feedback");
                return false;
            }
            if ($("#password").val() == "") {
                $("#password").css("border-color", "red");
                $('#password').attr("placeholder", "密码不能为空");
                $('#pass').attr("class", "glyphicon glyphicon-remove form-control-feedback");
                return false;
            }

        })
    });
</script>
</body>
</html>